package com.woniuxy.educationplatform.service.impl;

import com.woniuxy.educationplatform.bean.SpecialBean;
import com.woniuxy.educationplatform.mapper.SpecialMapper;
import com.woniuxy.educationplatform.service.ISpecialService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(readOnly = true)
public class SpecialServiceImpl implements ISpecialService {
    @Resource
    private SpecialMapper specialMapperImpl;


    @Override
    public List<SpecialBean> findAll() {
        return specialMapperImpl.findAll();
    }


    @Transactional(isolation = Isolation.REPEATABLE_READ, rollbackFor = Exception.class)
    @Override
    public int updateStatus(int id) {
        return specialMapperImpl.updateStatus(id);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ, rollbackFor = Exception.class)
    @Override
    public int putaway(int id) {
        return specialMapperImpl.putaway(id);
    }


    @Transactional(isolation = Isolation.REPEATABLE_READ, rollbackFor = Exception.class)
    @Override
    public int del(int id) {
        return specialMapperImpl.del(id);
    }

    @Override
    public List<SpecialBean> findAllByParams(SpecialBean specialBean) {
        return specialMapperImpl.findAllByParams(specialBean);
    }


    @Transactional(isolation = Isolation.REPEATABLE_READ, rollbackFor = Exception.class)
    @Override
    public int updateSpecial(SpecialBean specialBean) {
        return specialMapperImpl.updateSpecial(specialBean);
    }

    /**
     * 保存
     * @param specialBean
     * @return
     */
    @Transactional(isolation = Isolation.REPEATABLE_READ, rollbackFor = Exception.class)
    @Override
    public int saveColumn(SpecialBean specialBean) {
        return specialMapperImpl.saveColumn(specialBean);
    }


}
